<!DOCTYPE html>
<html>
    <head>
		<meta charset="utf-8">
		<title>转账记录</title>
		<link rel="stylesheet" href="__ADMIN_PATH__/component/pear/css/pear.css" />
		<style>
			.expand.pear-btn:hover {
				color: currentColor;
                background: none;
			}
			.expand.pear-btn {
				border: 1px solid rgba(255, 255, 255, 0)
			}
		</style>
	</head>
	<body class="pear-container">

		<div class="layui-card">
			<div class="layui-card-body">

			</div>
		</div>

		<div class="layui-card">
			<div class="layui-card-body">
				<table id="tableId" lay-filter="tableFilter"></table>
			</div>
		</div>

		<script src="__ADMIN_PATH__/component/layui/layui.js"></script>
		<script src="__ADMIN_PATH__/component/pear/pear.js"></script>
		<script>
			layui.use(['table', 'form', 'jquery','common', 'popup', 'loading'], function() {
				let table = layui.table;
				let form = layui.form;
				let $ = layui.jquery;
				let common = layui.common;
				var popup = layui.popup;
				let laydate = layui.laydate;
				let loading = layui.loading;

				let articleTable = table.render({
					elem: '#tableId',
					method: "post",
					url: "{:url('Yongjin/yj_log')}",
					limit: 20,
					page: true,
					even: true,
					skin: 'line',
					toolbar: "#toolbarTpl",
					cols: [[
						{type: "checkbox"},
						{field: "cash_id", title: "申请id", width:100},
						{field: "bank_username", title: "姓名", width:100},
						{field: "bank_accounts", title: "手机号", width:130},
						{field: "money", title: "转账金额", width:150},
						{field: "add_time_time", title: "转账时间", width:150},
						{field: "zz_status", title: "状态", width:150},
						{field: "msg", title:"失败原因"},
					]],
					done: function (res, curr, count) {
						console.log(res, curr, count)
					}
				});
				//日期时间范围
				laydate.render({
					elem: '#expire_start_time'
					, type: 'datetime'
					,theme: '#1E9FFF'
				});

				laydate.render({
					elem: '#expire_end_time'
					, type: 'datetime'
					,theme: '#1E9FFF'
				});
				form.on('submit(search)', function(data) {
					articleTable.reload({
						where: data.field,
						page: {curr: 1}
					});
					return false;
				});

				table.on("tool(tableFilter)", function (obj) {
					let data = obj.data;
					switch (obj.event) {
						case "audit":
							audit(data.audit_url);
						break;
					}
				});

				function audit(audit_url) {
					layer.open({
						type: 2,
						title: '审核',
						shade: 0.5,
						maxmin:true,
						area: [common.isModile() ? '100%' : '90%', common.isModile() ? '100%' : '90%'],
						content: audit_url
					});
				}
			});
		</script>

		<!-- 行工具栏模板 -->
		<script type="text/html" id="operationTpl">
			{{# if(d.status != 1){ }}
				<button class="pear-btn pear-btn-primary pear-btn-sm" title="审核" lay-event="audit">审核</button>
			{{# } }}
		</script>

	</body>
</html>